3.78 \(\int (d+e x) (a+b \log (c x^n))^2 \, dx\)

Optimal. Leaf size=101 \[ d x \left (a+b \log \left (c x^n\right )\right )^2-\frac{1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-2 a b d n x-2 b^2 d n x \log \left (c x^n\right )+2 b^2 d n^2 x+\frac{1}{4} b^2 e n^2 x^2 \]

[Out]

-2*a*b*d*n*x + 2*b^2*d*n^2*x + (b^2*e*n^2*x^2)/4 - 2*b^2*d*n*x*Log[c*x^n] - (b*e*n*x^2*(a + b*Log[c*x^n]))/2 +
 d*x*(a + b*Log[c*x^n])^2 + (e*x^2*(a + b*Log[c*x^n])^2)/2

________________________________________________________________________________________

Rubi [A]  time = 0.0715404, antiderivative size = 101, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.278, Rules used = {2330, 2296, 2295, 2305, 2304} \[ d x \left (a+b \log \left (c x^n\right )\right )^2-\frac{1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-2 a b d n x-2 b^2 d n x \log \left (c x^n\right )+2 b^2 d n^2 x+\frac{1}{4} b^2 e n^2 x^2 \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

-2*a*b*d*n*x + 2*b^2*d*n^2*x + (b^2*e*n^2*x^2)/4 - 2*b^2*d*n*x*Log[c*x^n] - (b*e*n*x^2*(a + b*Log[c*x^n]))/2 +
 d*x*(a + b*Log[c*x^n])^2 + (e*x^2*(a + b*Log[c*x^n])^2)/2

Rule 2330

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = Expand
Integrand[(a + b*Log[c*x^n])^p, (d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n, p, q, r}
, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[r]))

Rule 2296

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps

\begin{align*} \int (d+e x) \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\int \left (d \left (a+b \log \left (c x^n\right )\right )^2+e x \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=d \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx+e \int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=d x \left (a+b \log \left (c x^n\right )\right )^2+\frac{1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-(2 b d n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx-(b e n) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-2 a b d n x+\frac{1}{4} b^2 e n^2 x^2-\frac{1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+d x \left (a+b \log \left (c x^n\right )\right )^2+\frac{1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2-\left (2 b^2 d n\right ) \int \log \left (c x^n\right ) \, dx\\ &=-2 a b d n x+2 b^2 d n^2 x+\frac{1}{4} b^2 e n^2 x^2-2 b^2 d n x \log \left (c x^n\right )-\frac{1}{2} b e n x^2 \left (a+b \log \left (c x^n\right )\right )+d x \left (a+b \log \left (c x^n\right )\right )^2+\frac{1}{2} e x^2 \left (a+b \log \left (c x^n\right )\right )^2\\ \end{align*}

Mathematica [A]  time = 0.0475206, size = 77, normalized size = 0.76 \[ \frac{1}{4} x \left (4 d \left (a+b \log \left (c x^n\right )\right )^2-8 b d n \left (a+b \log \left (c x^n\right )-b n\right )+2 e x \left (a+b \log \left (c x^n\right )\right )^2+b e n x \left (-2 a-2 b \log \left (c x^n\right )+b n\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

(x*(b*e*n*x*(-2*a + b*n - 2*b*Log[c*x^n]) + 4*d*(a + b*Log[c*x^n])^2 + 2*e*x*(a + b*Log[c*x^n])^2 - 8*b*d*n*(a
 - b*n + b*Log[c*x^n])))/4

________________________________________________________________________________________

Maple [C]  time = 0.268, size = 1548, normalized size = 15.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2,x)

[Out]

-1/8*Pi^2*b^2*e*x^2*csgn(I*c*x^n)^6-1/4*Pi^2*b^2*d*csgn(I*c*x^n)^6*x-1/2*I*ln(c)*Pi*b^2*e*x^2*csgn(I*x^n)*csgn
(I*c*x^n)*csgn(I*c)+1/4*I*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^2*d*csgn(I*x^n)^2*csgn(I*c*x^n)^3*csgn(I*c)*x-1/4*Pi^2*b^2*d*csgn(I*x^n)^2*csgn(I*c*x^n)^2*csgn(I*c)^2
*x-Pi^2*b^2*d*csgn(I*x^n)*csgn(I*c*x^n)^4*csgn(I*c)*x-1/2*I*ln(c)*Pi*b^2*e*x^2*csgn(I*c*x^n)^3+1/4*I*b^2*n*Pi*
e*x^2*csgn(I*c*x^n)^3+I*b^2*n*Pi*d*csgn(I*c*x^n)^3*x-2*a*b*d*n*x+1/2*Pi^2*b^2*d*csgn(I*x^n)*csgn(I*c*x^n)^3*cs
gn(I*c)^2*x-1/8*Pi^2*b^2*e*x^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2*csgn(I*c)^2

________________________________________________________________________________________

Maxima [A]  time = 1.01274, size = 184, normalized size = 1.82 \begin{align*} \frac{1}{2} \, b^{2} e x^{2} \log \left (c x^{n}\right )^{2} - \frac{1}{2} \, a b e n x^{2} + a b e x^{2} \log \left (c x^{n}\right ) + b^{2} d x \log \left (c x^{n}\right )^{2} - 2 \, a b d n x + \frac{1}{2} \, a^{2} e x^{2} + 2 \, a b d x \log \left (c x^{n}\right ) + 2 \,{\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d + \frac{1}{4} \,{\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} e + a^{2} d x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/2*b^2*e*x^2*log(c*x^n)^2 - 1/2*a*b*e*n*x^2 + a*b*e*x^2*log(c*x^n) + b^2*d*x*log(c*x^n)^2 - 2*a*b*d*n*x + 1/2
*a^2*e*x^2 + 2*a*b*d*x*log(c*x^n) + 2*(n^2*x - n*x*log(c*x^n))*b^2*d + 1/4*(n^2*x^2 - 2*n*x^2*log(c*x^n))*b^2*
e + a^2*d*x

________________________________________________________________________________________

Fricas [B]  time = 1.02191, size = 459, normalized size = 4.54 \begin{align*} \frac{1}{4} \,{\left (b^{2} e n^{2} - 2 \, a b e n + 2 \, a^{2} e\right )} x^{2} + \frac{1}{2} \,{\left (b^{2} e x^{2} + 2 \, b^{2} d x\right )} \log \left (c\right )^{2} + \frac{1}{2} \,{\left (b^{2} e n^{2} x^{2} + 2 \, b^{2} d n^{2} x\right )} \log \left (x\right )^{2} +{\left (2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} d\right )} x - \frac{1}{2} \,{\left ({\left (b^{2} e n - 2 \, a b e\right )} x^{2} + 4 \,{\left (b^{2} d n - a b d\right )} x\right )} \log \left (c\right ) - \frac{1}{2} \,{\left ({\left (b^{2} e n^{2} - 2 \, a b e n\right )} x^{2} + 4 \,{\left (b^{2} d n^{2} - a b d n\right )} x - 2 \,{\left (b^{2} e n x^{2} + 2 \, b^{2} d n x\right )} \log \left (c\right )\right )} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/4*(b^2*e*n^2 - 2*a*b*e*n + 2*a^2*e)*x^2 + 1/2*(b^2*e*x^2 + 2*b^2*d*x)*log(c)^2 + 1/2*(b^2*e*n^2*x^2 + 2*b^2*
d*n^2*x)*log(x)^2 + (2*b^2*d*n^2 - 2*a*b*d*n + a^2*d)*x - 1/2*((b^2*e*n - 2*a*b*e)*x^2 + 4*(b^2*d*n - a*b*d)*x
)*log(c) - 1/2*((b^2*e*n^2 - 2*a*b*e*n)*x^2 + 4*(b^2*d*n^2 - a*b*d*n)*x - 2*(b^2*e*n*x^2 + 2*b^2*d*n*x)*log(c)
)*log(x)

________________________________________________________________________________________

Sympy [B]  time = 1.94152, size = 270, normalized size = 2.67 \begin{align*} a^{2} d x + \frac{a^{2} e x^{2}}{2} + 2 a b d n x \log{\left (x \right )} - 2 a b d n x + 2 a b d x \log{\left (c \right )} + a b e n x^{2} \log{\left (x \right )} - \frac{a b e n x^{2}}{2} + a b e x^{2} \log{\left (c \right )} + b^{2} d n^{2} x \log{\left (x \right )}^{2} - 2 b^{2} d n^{2} x \log{\left (x \right )} + 2 b^{2} d n^{2} x + 2 b^{2} d n x \log{\left (c \right )} \log{\left (x \right )} - 2 b^{2} d n x \log{\left (c \right )} + b^{2} d x \log{\left (c \right )}^{2} + \frac{b^{2} e n^{2} x^{2} \log{\left (x \right )}^{2}}{2} - \frac{b^{2} e n^{2} x^{2} \log{\left (x \right )}}{2} + \frac{b^{2} e n^{2} x^{2}}{4} + b^{2} e n x^{2} \log{\left (c \right )} \log{\left (x \right )} - \frac{b^{2} e n x^{2} \log{\left (c \right )}}{2} + \frac{b^{2} e x^{2} \log{\left (c \right )}^{2}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*d*x + a**2*e*x**2/2 + 2*a*b*d*n*x*log(x) - 2*a*b*d*n*x + 2*a*b*d*x*log(c) + a*b*e*n*x**2*log(x) - a*b*e*n
*x**2/2 + a*b*e*x**2*log(c) + b**2*d*n**2*x*log(x)**2 - 2*b**2*d*n**2*x*log(x) + 2*b**2*d*n**2*x + 2*b**2*d*n*
x*log(c)*log(x) - 2*b**2*d*n*x*log(c) + b**2*d*x*log(c)**2 + b**2*e*n**2*x**2*log(x)**2/2 - b**2*e*n**2*x**2*l
og(x)/2 + b**2*e*n**2*x**2/4 + b**2*e*n*x**2*log(c)*log(x) - b**2*e*n*x**2*log(c)/2 + b**2*e*x**2*log(c)**2/2

________________________________________________________________________________________

Giac [B]  time = 1.48279, size = 304, normalized size = 3.01 \begin{align*} \frac{1}{2} \, b^{2} n^{2} x^{2} e \log \left (x\right )^{2} - \frac{1}{2} \, b^{2} n^{2} x^{2} e \log \left (x\right ) + b^{2} n x^{2} e \log \left (c\right ) \log \left (x\right ) + b^{2} d n^{2} x \log \left (x\right )^{2} + \frac{1}{4} \, b^{2} n^{2} x^{2} e - \frac{1}{2} \, b^{2} n x^{2} e \log \left (c\right ) + \frac{1}{2} \, b^{2} x^{2} e \log \left (c\right )^{2} - 2 \, b^{2} d n^{2} x \log \left (x\right ) + a b n x^{2} e \log \left (x\right ) + 2 \, b^{2} d n x \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d n^{2} x - \frac{1}{2} \, a b n x^{2} e - 2 \, b^{2} d n x \log \left (c\right ) + a b x^{2} e \log \left (c\right ) + b^{2} d x \log \left (c\right )^{2} + 2 \, a b d n x \log \left (x\right ) - 2 \, a b d n x + \frac{1}{2} \, a^{2} x^{2} e + 2 \, a b d x \log \left (c\right ) + a^{2} d x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/2*b^2*n^2*x^2*e*log(x)^2 - 1/2*b^2*n^2*x^2*e*log(x) + b^2*n*x^2*e*log(c)*log(x) + b^2*d*n^2*x*log(x)^2 + 1/4
*b^2*n^2*x^2*e - 1/2*b^2*n*x^2*e*log(c) + 1/2*b^2*x^2*e*log(c)^2 - 2*b^2*d*n^2*x*log(x) + a*b*n*x^2*e*log(x) +
 2*b^2*d*n*x*log(c)*log(x) + 2*b^2*d*n^2*x - 1/2*a*b*n*x^2*e - 2*b^2*d*n*x*log(c) + a*b*x^2*e*log(c) + b^2*d*x
*log(c)^2 + 2*a*b*d*n*x*log(x) - 2*a*b*d*n*x + 1/2*a^2*x^2*e + 2*a*b*d*x*log(c) + a^2*d*x